import * as cc from "cc";

import { GamePlatformType } from "./GamePlatformType";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GamePlatformConfig extends cc.Component {
    //平台。
    @property({ type: cc.Enum(GamePlatformType) })
    public type: GamePlatformType = GamePlatformType.PC;

    @property({
        displayName: "项目appId",
        visible() {
            return this.type != GamePlatformType.PC;
        },
    })
    public appId: string = "";

    @property({
        displayName: "项目secret",
        visible() {
            return this.type == GamePlatformType.WX;
        },
    })
    public secret: string = "";

    //#region 白鹰SDK专属属性
    @property({
        displayName: "游戏版本号",
        tooltip: "白鹰SDK专属，游戏版本号，与打包OPPO时的版本号一致",
        visible() {
            return this.type == GamePlatformType.HeyGameOPPO
                || this.type == GamePlatformType.HeyGameVIVO;
        },
    })
    public heyVersionName: string = "1.0.0";

    @property({
        displayName: "九宫格广告id",
        visible() {
            return this.type == GamePlatformType.HeyGameOPPO
                || this.type == GamePlatformType.HeyGameVIVO;
        },
    })
    public heyDrawerGameAdUnitId: string = "";

    @property({
        displayName: "原生banner广告id",
        visible() {
            return this.type == GamePlatformType.HeyGameOPPO
                || this.type == GamePlatformType.HeyGameVIVO;
        },
    })
    public heyBannerGameAdUnitId: string = "";

    @property({
        displayName: "原生广告Id",
        tooltip: "第0个为首页/关卡中id，第1个为结算页id",
        type: [cc.CCString],
        visible() {
            return this.type == GamePlatformType.HeyGameOPPO
                || this.type == GamePlatformType.HeyGameVIVO;
        }
    })
    public heyNativeAdUnitId: string[] = [];
    //#endregion

    @property({
        displayName: "视频广告Id",
        type: [cc.CCString],
        visible() {
            return this.type != GamePlatformType.PC;
        },
    })
    public videoAdUnitId: string[] = [];

    @property({
        displayName: "BannerId",
        type: [cc.CCString],
        visible() {
            return this.type != GamePlatformType.PC;
        },
    })
    public BannerAdUnitId: string[] = [];

    @property({
        displayName: "插屏Id",
        type: [cc.CCString],
        visible() {
            return this.type != GamePlatformType.PC;
        },
    })
    public InterstitialAdUnitId: string[] = [];

    @property({
        displayName: "原生广告Id",
        type: [cc.CCString],
        visible() {
            return this.type == GamePlatformType.WX;
        }
    })
    public nativeAdUnitId: string[] = [];

    //#region QQ平台专属广告id
    @property({
        displayName: "盒子广告Id",
        type: [cc.CCString],
        visible() {
            return this.type == GamePlatformType.QQ;
        },
    })
    public appBoxUnitId: string[] = [];

    @property({
        displayName: "积木广告Id",
        type: [cc.CCString],
        visible() {
            return this.type == GamePlatformType.QQ;
        },
    })
    public blockAdUnitId: string[] = [];
    //#endregion

}
